﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="copyandmove.aspx.cs" Inherits="Smy.Web.Admin.Info.copyandmove" %>

<%@ Import Namespace="Smy.Common" %>

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta name="viewport" content="width=device-width,minimum-scale=1.0,maximum-scale=1.0,initial-scale=1.0,user-scalable=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <title>内容管理</title>
    <link href="../../scripts/artdialog/ui-dialog.css" rel="stylesheet" type="text/css" />
    <link href="../skin/default/style.css" rel="stylesheet" type="text/css" />
    <link href="../../css/pagination.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript" src="../../scripts/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" src="../../scripts/jquery/jquery.lazyload.min.js"></script>
    <script type="text/javascript" src="../../scripts/artdialog/dialog-plus-min.js"></script>
    <script src="../../scripts/zclip/jquery.zclip.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/laymain.js"></script>
    <script type="text/javascript" charset="utf-8" src="../js/common.js"></script>
    <script type="text/javascript">
        $(function () {
            //        imgLayout();
            //        $(window).resize(function () {
            //            imgLayout();
            //        });
            //图片延迟加载
            $(".pic img").lazyload({
                // load: AutoResizeImage,
                effect: "fadeIn"
            });
            //点击图片链接
            $(".pic img").click(function () {
                //$.dialog({ lock: true, title: "查看大图", content: "<img src=\"" + $(this).attr("src") + "\" />", padding: 0 });
                var linkUrl = $(this).parent().parent().find(".foot a").attr("href");
                if (linkUrl != "") {
                    location.href = linkUrl; //跳转到修改页面
                }
            });
        });
        //排列图文列表
        function imgLayout() {
            var imgWidth = $(".imglist").width();
            var lineCount = Math.floor(imgWidth / 222);
            var lineNum = imgWidth % 222 / (lineCount - 1);
            $(".imglist ul").width(imgWidth + Math.ceil(lineNum));
            $(".imglist ul li").css("margin-right", parseFloat(lineNum));
        }
        //    //等比例缩放图片大小
        //    function AutoResizeImage(e, s) {
        //        var img = new Image();
        //        img.src = $(this).attr("src")
        //        var w = img.width;
        //        var h = img.height;
        //        var wRatio = w / h;
        //        if ((220 / wRatio) >= 165) {
        //            $(this).width(220); $(this).height(220 / wRatio);
        //        } else {
        //            $(this).width(165 * wRatio); $(this).height(165);
        //        }
        //    }


        $(function () {
            $('.J_copy').zclip({
                path: "/scripts/zclip/ZeroClipboard.swf",
                copy: function () {
                    var $this = $(this);
                    return $this.data('id')
                },
                afterCopy: function () {
                    jsprint("已经复制到剪切板", "")
                }
            })
        })
    </script>
</head>

<body class="mainbody">
    <form id="form1" runat="server">
        <!--导航栏-->
        <div class="location">
            <a href="javascript:history.back(-1);" class="back"><i></i><span>返回上一页</span></a>
            <a href="../center.aspx" class="home"><i></i><span>首页</span></a>
            <i class="arrow"></i>
            <span>复制或移动内容</span>
        </div>
        <!--/导航栏-->

        <!--工具栏-->
        <div id="floatHead" class="toolbar-wrap">
            <div class="toolbar">
                <div class="box-wrap">
                    <a class="menu-btn"></a>
                    <div class="l-list">
                        <ul class="icon-list">
                            <li runat="server" visible="false"><a class="add" href="InfoEdit.aspx?action=<%=STEnums.ActionEnum.Add %>&channel_id=<%=this.channel_id %>"><i></i><span>新增</span></a></li>
                            <li runat="server" visible="false"><asp:LinkButton ID="btnSave" runat="server" CssClass="save" OnClick="btnSave_Click"><i></i><span>保存</span></asp:LinkButton></li>
                            <li runat="server" visible="false"><asp:LinkButton ID="btnAudit" runat="server" CssClass="lock" OnClientClick="return ExePostBack('btnAudit','审核后前台将显示该信息，确定继续吗？');" OnClick="btnAudit_Click"><i></i><span>审核</span></asp:LinkButton></li>
                            <li><a class="all" href="javascript:;" onclick="checkAll(this);"><i></i><span>全选</span></a></li>
                            <%--<li><asp:LinkButton ID="btnDelete" runat="server" CssClass="del" OnClientClick="return ExePostBack('btnDelete');" OnClick="btnDelete_Click"><i></i><span>删除</span></asp:LinkButton></li>--%>
                        </ul>
                        <div class="menu-list">
                            选择复制或移动后的位置
                            <div class="rule-single-select">
                                <asp:DropDownList ID="ddlToChannelSiteId" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlToChannelSiteId_SelectedIndexChanged"></asp:DropDownList>
                            </div>

                            <div class="rule-single-select" runat="server" id="divChannel" visible="false">
                                <asp:DropDownList ID="ddlToChannelId" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlToChannelId_SelectedIndexChanged"></asp:DropDownList>
                            </div>
                            <div class="rule-single-select" runat="server" id="divCategory" visible="false">
                                <asp:DropDownList ID="ddlToCategoryId" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlToCategoryId_SelectedIndexChanged"></asp:DropDownList>
                            </div>
                        </div>
                        <ul class="icon-list" runat="server" id="divAction" visible="false">
                            <li>
                                <asp:LinkButton ID="btnCopy" runat="server" CssClass="copy" OnClientClick="return ExePostBack('btnCopy','批量复制可能会造成网站文件庞大，确定要复制吗？');" OnClick="btnCopy_Click"><i></i><span>复制</span></asp:LinkButton></li>
                            <li>
                                <asp:LinkButton ID="btnMove" runat="server" CssClass="copy" OnClick="btnMove_Click"><i></i><span>移动</span></asp:LinkButton></li>
                        </ul>
                    </div>
                    <div class="r-list">
                        <asp:TextBox ID="txtKeywords" runat="server" CssClass="keyword" />
                        <asp:LinkButton ID="lbtnSearch" runat="server" CssClass="btn-search" OnClick="btnSearch_Click">查询</asp:LinkButton>
                        <asp:LinkButton ID="lbtnViewImg" runat="server" CssClass="img-view" OnClick="lbtnViewImg_Click" ToolTip="图像列表视图" />
                        <asp:LinkButton ID="lbtnViewTxt" runat="server" CssClass="txt-view" OnClick="lbtnViewTxt_Click" ToolTip="文字列表视图" />
                    </div>
                </div>
            </div>
        </div>
        <!--/工具栏-->

        <!--列表-->
        <div class="table-container">
            <!--文字列表-->
            <asp:Repeater ID="rptList1" runat="server" OnItemCommand="rptList_ItemCommand">
                <HeaderTemplate>
                    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="ltable">
                        <tr>
                            <th width="6%">选择</th>
                            <th align="left">标题</th>
                            <th align="left" width="12%">所属类别</th>
                            <th align="left" width="16%">发布时间</th>
                            <th align="left" width="65">排序</th>
                            <th align="left" width="120">属性</th>
                            <th width="10%">操作</th>
                        </tr>
                </HeaderTemplate>
                <ItemTemplate>
                    <tr>
                        <td align="center">
                            <asp:CheckBox ID="chkId" CssClass="checkall" runat="server" Style="vertical-align: middle;" />
                            <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                            <span class="info-id"><%#Eval("id") %></span>
                        </td>
                        <td><a href="InfoEdit.aspx?action=<%#STEnums.ActionEnum.Edit %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>"><%#Eval("title")%></a></td>
                        <td><%#new Smy.BLL.InfoCategory().GetTitle(Convert.ToInt32(Eval("category_id")))%></td>
                        <td><%#string.Format("{0:yyyy-MM-dd HH:mm:ss}",Eval("add_time"))%></td>
                        <td>
                            <asp:TextBox ID="txtSortId" runat="server" Text='<%#Eval("sort_id")%>' CssClass="sort" onkeydown="return checkNumber(event);" /></td>
                        <td>
                            <div class="btn-tools">
                                <asp:LinkButton ID="lbtnIsMsg" CommandName="lbtnIsMsg" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_msg")) == 1 ? "msg selected" : "msg"%>' ToolTip='<%# Convert.ToInt32(Eval("is_msg")) == 1 ? "取消评论" : "设置评论"%>' />
                                <asp:LinkButton ID="lbtnIsTop" CommandName="lbtnIsTop" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_top")) == 1 ? "top selected" : "top"%>' ToolTip='<%# Convert.ToInt32(Eval("is_top")) == 1 ? "取消置顶" : "设置置顶"%>' />
                                <asp:LinkButton ID="lbtnIsRed" CommandName="lbtnIsRed" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "red selected" : "red"%>' ToolTip='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "取消推荐" : "设置推荐"%>' />
                                <asp:LinkButton ID="lbtnIsHot" CommandName="lbtnIsHot" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "hot selected" : "hot"%>' ToolTip='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "取消热门" : "设置热门"%>' />
                                <asp:LinkButton ID="lbtnIsSlide" CommandName="lbtnIsSlide" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_slide")) == 1 ? "pic selected" : "pic"%>' ToolTip='<%# Convert.ToInt32(Eval("is_slide")) == 1 ? "取消幻灯片" : "设置幻灯片"%>' />
                            </div>
                        </td>
                        <td align="center" style="position: relative">
                            <a href="javascript:" class="J_copy" data-id="<%#Eval("id") %>">复制编号</a>
                            <a href="InfoEdit.aspx?action=<%#STEnums.ActionEnum.Copy %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>">复制</a>
                            <a href="InfoEdit.aspx?action=<%#STEnums.ActionEnum.Edit %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>">修改</a>
                        </td>
                    </tr>
                </ItemTemplate>
                <FooterTemplate>
                    <%#rptList1.Items.Count == 0 ? "<tr><td align=\"center\" colspan=\"7\">暂无记录</td></tr>" : ""%>
  </table>
                </FooterTemplate>
            </asp:Repeater>
            <!--/文字列表-->

            <!--图片列表-->
            <asp:Repeater ID="rptList2" runat="server" OnItemCommand="rptList_ItemCommand">
                <HeaderTemplate>
                    <div class="imglist">
                        <ul>
                </HeaderTemplate>
                <ItemTemplate>
                    <li>
                        <div class="details<%#Eval("img_url").ToString() != "" ? "" : " nopic"%>">
                            <div class="check">
                                <asp:CheckBox ID="chkId" CssClass="checkall" runat="server" />
                                <asp:HiddenField ID="hidId" Value='<%#Eval("id")%>' runat="server" />
                            </div>
                            <%#Eval("img_url").ToString() != "" ? "<div class=\"pic\"><img src=\"../skin/default/loadimg.gif\" data-original=\"" + Eval("img_url") + "\" /></div><i class=\"absbg\"></i>" : ""%>
                            <h1><span><a href="InfoEdit.aspx?action=<%#STEnums.ActionEnum.Edit %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>"><%#Eval("title")%></a></span></h1>
                            <div class="remark">
                                <%#Eval("zhaiyao").ToString() == "" ? "暂无内容摘要说明..." : Eval("zhaiyao").ToString()%>
                            </div>
                            <div class="tools">
                                <asp:LinkButton ID="lbtnIsMsg" CommandName="lbtnIsMsg" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_msg")) == 1 ? "msg selected" : "msg"%>' ToolTip='<%# Convert.ToInt32(Eval("is_msg")) == 1 ? "取消评论" : "设置评论"%>' />
                                <asp:LinkButton ID="lbtnIsTop" CommandName="lbtnIsTop" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_top")) == 1 ? "top selected" : "top"%>' ToolTip='<%# Convert.ToInt32(Eval("is_top")) == 1 ? "取消置顶" : "设置置顶"%>' />
                                <asp:LinkButton ID="lbtnIsRed" CommandName="lbtnIsRed" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "red selected" : "red"%>' ToolTip='<%# Convert.ToInt32(Eval("is_red")) == 1 ? "取消推荐" : "设置推荐"%>' />
                                <asp:LinkButton ID="lbtnIsHot" CommandName="lbtnIsHot" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "hot selected" : "hot"%>' ToolTip='<%# Convert.ToInt32(Eval("is_hot")) == 1 ? "取消热门" : "设置热门"%>' />
                                <asp:LinkButton ID="lbtnIsSlide" CommandName="lbtnIsSlide" runat="server" CssClass='<%# Convert.ToInt32(Eval("is_slide")) == 1 ? "pic selected" : "pic"%>' ToolTip='<%# Convert.ToInt32(Eval("is_slide")) == 1 ? "取消幻灯片" : "设置幻灯片"%>' />
                                <asp:TextBox ID="txtSortId" runat="server" Text='<%#Eval("sort_id")%>' CssClass="sort" onkeypress="return (/[\d]/.test(String.fromCharCode(event.keyCode)));" />
                            </div>
                            <div class="foot">
                                <p class="time"><%#string.Format("{0:yyyy-MM-dd HH:mm:ss}", Eval("add_time"))%></p>
                                <a href="InfoEdit.aspx?action=<%#STEnums.ActionEnum.Edit %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>" title="编辑" class="edit">编辑</a>
                                <a href="InfoEdit.aspx?action=<%#STEnums.ActionEnum.Copy %>&channel_id=<%#this.channel_id %>&id=<%#Eval("id")%>" title="复制" class="copy">复制</a>
                                <a href="javascript:" class="J_copy zcopy" data-id="<%#Eval("id") %>">复制编号</a>
                            </div>
                        </div>
                    </li>
                </ItemTemplate>
                <FooterTemplate>
                    <%#rptList2.Items.Count == 0 ? "<div align=\"center\" style=\"font-size:12px;line-height:30px;color:#666;\">暂无记录</div>" : ""%>
    </ul>
  </div>
                </FooterTemplate>
            </asp:Repeater>
            <!--/图片列表-->
        </div>
        <!--/列表-->

        <!--内容底部-->
        <div class="line20"></div>
        <div class="pagelist">
            <div class="l-btns">
                <span>显示</span><asp:TextBox ID="txtPageNum" runat="server" CssClass="pagenum" onkeydown="return checkNumber(event);"
                    OnTextChanged="txtPageNum_TextChanged" AutoPostBack="True"></asp:TextBox><span>条/页</span>
            </div>
            <div id="PageContent" runat="server" class="default"></div>
        </div>
        <!--/内容底部-->

    </form>
</body>
</html>
